package com.conselheiro.web.persistence;


import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

import es.claro.persistence.PersistenceManager;

public class GerenciadorJPA {

	private static final String PERSISTENCE_UNIT = "Conselheiro";
	private static EntityManagerFactory entityManagerFactoryScoped;
	private static EntityManagerFactory entityManagerFactoryInternal;
	static {
		PersistenceManager.setPersistenceUnit(PERSISTENCE_UNIT);
		entityManagerFactoryScoped = PersistenceManager.getInstance()
				.getEntityManagerFactory();
		entityManagerFactoryInternal = Persistence
				.createEntityManagerFactory(PERSISTENCE_UNIT);
	}

	public static EntityManagerFactory getScopedEntityManagerFactory() {
		return entityManagerFactoryScoped;
	}

	public static EntityManagerFactory getInternalEntityManagerFactory() {
		return entityManagerFactoryInternal;
	}
}
